/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CSemaforo.java
 *
 * Created on 31-mar-2011, 10:33:56
 */
package semaforo;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

/**
 *
 * @author cesar
 */
public class CSemaforo extends javax.swing.JFrame {

    /** Creates new form CSemaforo */
    public CSemaforo() {
        initComponents();
//        RbPDO.setVisible(false);
//        RbPO.setVisible(false);
//        RbSDO.setVisible(false);
//        RbSO.setVisible(false);
//        //
        RBP1O.setVisible(false);
        RBP1DO.setVisible(false);
        RBP2O.setVisible(false);
        RBP2DO.setVisible(false);
        RBS1O.setVisible(false);
        RBS1DO.setVisible(false);
        RBS2O.setVisible(false);
        RBS2DO.setVisible(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelImagen = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        RbPO = new javax.swing.JRadioButton();
        RbPDO = new javax.swing.JRadioButton();
        RBP2O = new javax.swing.JRadioButton();
        RBP2DO = new javax.swing.JRadioButton();
        RBP1O = new javax.swing.JRadioButton();
        RBP1DO = new javax.swing.JRadioButton();
        cbBusqueda1 = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLSemaforoP = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        RbSDO = new javax.swing.JRadioButton();
        RbSO = new javax.swing.JRadioButton();
        RBS2DO = new javax.swing.JRadioButton();
        RBS2O = new javax.swing.JRadioButton();
        RBS1DO = new javax.swing.JRadioButton();
        RBS1O = new javax.swing.JRadioButton();
        jPanel4 = new javax.swing.JPanel();
        jLSemaforoS = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelImagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/simple.jpg"))); // NOI18N
        jLabelImagen.setText("jLabel1");

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Calle Principal"));

        RbPO.setText("Ocupada ");
        RbPO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RbPOActionPerformed(evt);
            }
        });

        RbPDO.setText("Desocupada");
        RbPDO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RbPDOActionPerformed(evt);
            }
        });

        RBP2O.setText("Principal 2 ocupada");
        RBP2O.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBP2OActionPerformed(evt);
            }
        });

        RBP2DO.setText("Principal 2 desocupada");

        RBP1O.setText("Principal 1 ocupada");

        RBP1DO.setText("Principal 1 desocupada");
        RBP1DO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBP1DOActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(RBP2DO)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(RBP1O)
                            .addComponent(RBP1DO))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(RbPDO)
                            .addComponent(RbPO)))
                    .addComponent(RBP2O))
                .addContainerGap(53, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(RBP1O)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(RBP1DO))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(RbPO)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(RbPDO)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(RBP2O)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(RBP2DO)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        cbBusqueda1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Simple", "Doble" }));
        cbBusqueda1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cbBusqueda1MouseClicked(evt);
            }
        });
        cbBusqueda1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbBusqueda1ItemStateChanged(evt);
            }
        });
        cbBusqueda1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbBusqueda1ActionPerformed(evt);
            }
        });
        cbBusqueda1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                cbBusqueda1KeyPressed(evt);
            }
        });

        jButton1.setText("Optimizar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Semáforo Calle Principal"));

        jLSemaforoP.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLSemaforoP, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLSemaforoP, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)
                .addContainerGap())
        );

        jButton2.setText("Nuevo");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Calle Secundaria"));

        RbSDO.setText("Desocupada");
        RbSDO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RbSDOActionPerformed(evt);
            }
        });

        RbSO.setText("Ocupada");
        RbSO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RbSOActionPerformed(evt);
            }
        });

        RBS2DO.setText("Secundaria 2 desocupada");

        RBS2O.setText("Secundaria 2 ocupada");

        RBS1DO.setText("Secundaria 1 desocupada");

        RBS1O.setText("Secundaria 1 ocupada");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(RBS2O)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(RBS1DO)
                            .addComponent(RBS1O))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(RbSO)
                            .addComponent(RbSDO)))
                    .addComponent(RBS2DO))
                .addContainerGap(39, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(RBS1O)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(RBS1DO))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(RbSO)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(RbSDO)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(RBS2O)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(RBS2DO)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Semáforo Calle Secundaria"));

        jLSemaforoS.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLSemaforoS, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLSemaforoS, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)
                .addContainerGap())
        );

        jMenu1.setText("File");
        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabelImagen, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cbBusqueda1, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton2)
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabelImagen)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(101, 101, 101)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addGap(61, 61, 61)
                                    .addComponent(cbBusqueda1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton1)
                            .addComponent(jButton2))
                        .addGap(101, 101, 101)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void RbSOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RbSOActionPerformed
        // TODO add your handling code here:
        if (RbSO.isSelected()==true) {
            RbSDO.setEnabled(false);
        }
    }//GEN-LAST:event_RbSOActionPerformed

    private void RbPOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RbPOActionPerformed
        // TODO add your handling code here:
        if (RbPO.isSelected()==true) {
            RbPDO.setEnabled(false);
        }
    }//GEN-LAST:event_RbPOActionPerformed

    private void RBP1DOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RBP1DOActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_RBP1DOActionPerformed

    private void RBP2OActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RBP2OActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_RBP2OActionPerformed

    private void RbPDOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RbPDOActionPerformed
        // TODO add your handling code here:
         if (RbPDO.isSelected()==true) {
            RbPO.setEnabled(false);
        }
    }//GEN-LAST:event_RbPDOActionPerformed

    private void cbBusqueda1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbBusqueda1ActionPerformed
    }//GEN-LAST:event_cbBusqueda1ActionPerformed

    private void cbBusqueda1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cbBusqueda1MouseClicked
    }//GEN-LAST:event_cbBusqueda1MouseClicked

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        if (cbBusqueda1.getSelectedItem().equals("Simple")) {

            if (RbPO.isSelected()==true&&RbPDO.isSelected()==false&&RbSO.isSelected()==false&&RbSDO.isSelected()==false) {
                jLSemaforoP.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoVerde.png")));
                jLSemaforoS.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoRojo.png")));
                //System.out.println("semaforo en verde");
            }
            if (RbSO.isSelected()==true&&RbPO.isSelected()==false&&RbPDO.isSelected()==false&&RbSDO.isSelected()==false) {
                jLSemaforoP.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoRojo.png")));
                jLSemaforoS.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoVerde.png")));
                //System.out.println("semaforo en verde");
            }
            if (RbPDO.isSelected()==true&&RbPO.isSelected()==false&&RbSDO.isSelected()==false&&RbSO.isSelected()==false) {
                jLSemaforoP.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoRojo.png")));
                jLSemaforoS.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoVerde.png")));
                //System.out.println("semaforo en verde");
            }

            if (RbPO.isSelected()==true&&(RbSO.isSelected()==true||RbSDO.isSelected()==true)){
                jLSemaforoP.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoVerde.png")));
                jLSemaforoS.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoRojo.png")));
                //System.out.println("semaforo en verde");
            }
            
            if (RbPDO.isSelected()==true&&RbSO.isSelected()==true) {
                //System.out.println("semaforo en verde");
                jLSemaforoP.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoRojo.png")));
                jLSemaforoS.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoVerde.png")));
            }

            if (RbPDO.isSelected()==true&&RbSDO.isSelected()==true) {
                //System.out.println("semaforo en verde");
                jLSemaforoP.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoVerde.png")));
                jLSemaforoS.setIcon(new ImageIcon(getClass().getResource("/Imagenes/semaforoRojo.png")));
            }

        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void cbBusqueda1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbBusqueda1ItemStateChanged
        // TODO add your handling code here:
        if (cbBusqueda1.getSelectedItem().equals("Simple")) {
            jLabelImagen.setIcon(new ImageIcon(getClass().getResource("/Imagenes/simple.jpg")));
             RbPDO.setVisible(true);
            RbPO.setVisible(true);
            RbSDO.setVisible(true);
            RbSO.setVisible(true);
            //
            RBP1O.setVisible(false);
            RBP1DO.setVisible(false);
            RBP2O.setVisible(false);
            RBP2DO.setVisible(false);
            RBS1O.setVisible(false);
            RBS1DO.setVisible(false);
            RBS2O.setVisible(false);
            RBS2DO.setVisible(false);


        }
        if (cbBusqueda1.getSelectedItem().equals("Doble")) {
            jLabelImagen.setIcon(new ImageIcon(getClass().getResource("/Imagenes/doble.jpg")));
            RbPDO.setVisible(false);
            RbPO.setVisible(false);
            RbSDO.setVisible(false);
            RbSO.setVisible(false);
            //
            RBP1O.setVisible(true);
            RBP1DO.setVisible(true);
            RBP2O.setVisible(true);
            RBP2DO.setVisible(true);
            RBS1O.setVisible(true);
            RBS1DO.setVisible(true);
            RBS2O.setVisible(true);
            RBS2DO.setVisible(true);


        }

    }//GEN-LAST:event_cbBusqueda1ItemStateChanged

    private void cbBusqueda1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cbBusqueda1KeyPressed
    }//GEN-LAST:event_cbBusqueda1KeyPressed

    private void RbSDOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RbSDOActionPerformed
        // TODO add your handling code here:
        if (RbSDO.isSelected()==true) {
            RbSO.setEnabled(false);
        }
    }//GEN-LAST:event_RbSDOActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        RbPO.setEnabled(true);
        RbPDO.setEnabled(true);
        RbSO.setEnabled(true);
        RbSDO.setEnabled(true);
        RbPO.setSelected(false);
        RbPDO.setSelected(false);
        RbSO.setSelected(false);
        RbSDO.setSelected(false);
        jLSemaforoP.setIcon(null);
        jLSemaforoS.setIcon(null);

    }//GEN-LAST:event_jButton2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new CSemaforo().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton RBP1DO;
    private javax.swing.JRadioButton RBP1O;
    private javax.swing.JRadioButton RBP2DO;
    private javax.swing.JRadioButton RBP2O;
    private javax.swing.JRadioButton RBS1DO;
    private javax.swing.JRadioButton RBS1O;
    private javax.swing.JRadioButton RBS2DO;
    private javax.swing.JRadioButton RBS2O;
    private javax.swing.JRadioButton RbPDO;
    private javax.swing.JRadioButton RbPO;
    private javax.swing.JRadioButton RbSDO;
    private javax.swing.JRadioButton RbSO;
    private javax.swing.JComboBox cbBusqueda1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLSemaforoP;
    private javax.swing.JLabel jLSemaforoS;
    private javax.swing.JLabel jLabelImagen;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    // End of variables declaration//GEN-END:variables
}
